<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var i = 1
        if (i > -1) {
            var b = 10
        }
        console.log(b);
        while (i < 10) {
            var j = 20
            i += 2

        }
        console.log(i, j);

        for (var j = 1; j <= 100; j++) {
            if (j % 2) {
                console.log(j);

            }

        }

        for (var k = 1; k <= 100; k++) {
            if (k % 5 == 0 && k % 7 == 0) {
                console.log(k);
            }

        }
        // 偶数
        var i = 1;
        var sum = 0
        while (i <= 10) {
            if (i % 2) {
                sum += i
            }
            i++
        }
        console.log(sum);


        for (var i = 0; i < 100; i++) {
            if (i % 5 == 0 && i % 7 == 0) {
                //    continue后面代码不执行
                continue

            }
            console.log(i);
        }

        console.log('1165485-------------------');
        for (var j = 1; j < 100; j++) {
            if (j % 5 == 0 && j % 7 == 0) {
                // 终止循环
                break
            }
            console.log(j);

        }


    </script>
</body>

</html>